import {hrAjax as proFetch} from 'src/hrpub/common/utils/utils';

export default function viewCard() {
    const {humanResourceOrganizationValue} = this.state;
    const clickRow = this.props.editTable.getCheckedRows('ncc60071701list');
    const params = {
        pk_org: humanResourceOrganizationValue.refpk,
        allPsnPk: this.props.editTable
            .getAllRows('ncc60071701list')
            .map((item) => item.values.pk_psndoc.value)
            .join('_'),
        selRow: clickRow[0] && clickRow[0].index
    };
    proFetch({
        url: '/nccloud/hrhi/psndoc/PsndocCardReptQueryAction.do',
        body: params
    }).then((res) => {
        if (res.success && res.data) {
            let location = window.location;
            location.port
                ? window.open('uclient://start/http://' + location.hostname + ':' + location.port + res.data)
                : window.open('uclient://start/http://' + location.hostname + res.data);
        }
    });
}
